package cn.com.blueInfo.bpm.number.convert;

import cn.com.blueInfo.bpm.common.convert.BaseConvert;
import cn.com.blueInfo.bpm.number.entity.NumberRuleComponent;
import cn.com.blueInfo.bpm.number.request.NumberRuleComponentDTO;
import cn.com.blueInfo.bpm.number.response.NumberRuleComponentVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

/**
 * 编号规则组成配置表 对象转换
 * @author suxch
 * @since 2025-08-31 16:13:48
 */
@Mapper(componentModel = "spring")
public interface NumberRuleComponentConvert
        extends BaseConvert<NumberRuleComponent, NumberRuleComponentDTO, NumberRuleComponentVO> {

    NumberRuleComponent dtoToEntity(NumberRuleComponentDTO dto);

    NumberRuleComponent dtoToEntity(NumberRuleComponentDTO.UpdatePartialDTO dto);

    @Mapping(source = "status", target = "status", qualifiedByName = "enumToDesc")
    @Mapping(source = "deleted", target = "deleted", qualifiedByName = "enumToDesc")
    @Mapping(source = "componentType", target = "componentType", qualifiedByName = "enumToDesc")
    NumberRuleComponentVO entityToVO(NumberRuleComponent entity);

}